﻿namespace Sidvall.IdentityManager.Data.Entity.Entities
{
    public partial class AspNetRoles : global::Sidvall.Data.DataRowBase, global::Sidvall.IdentityManager.Data.IAspNetRoles
    {
        #region Public Members

        #region Id

        private string _Id;
        public string Id
        { 
            get
            {
                return _Id;
            }
            set
            {
                _Id = value;
            }
        }

        #endregion
        #region Name

        private string _Name;
        public string Name
        { 
            get
            {
                return _Name;
            }
            set
            {
                _Name = value;
            }
        }

        #endregion
        
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual System.Collections.Generic.ICollection<Sidvall.IdentityManager.Data.Entity.Entities.AspNetUsers> AspNetUsers { get; set; }
        
        #region DataRowContextStorageKey

        protected override string DataRowContextStorageKey
        {
            get
            {
                return global::Sidvall.IdentityManager.Data.Entity.SystemContext.Current.EntityFacade.AspNetRolesManager.GetKey(this);
            }
        }

        #endregion
        #region DataRowStateIsDirty

        protected override bool DataRowStateIsDirty
        {
            get
            {
                return global::Sidvall.IdentityManager.Data.Entity.SystemContext.Current.EntityFacade.AspNetRolesManager.DataRowStateIsDirty(this);
            }
        }

        #endregion

        #region IAspNetRoles Members

        string global::Sidvall.IdentityManager.Data.IAspNetRoles.Id
        {
            get
            {
                return this._Id;
            }
            set
            {
                this.Id = value;
            }
        }
        string global::Sidvall.IdentityManager.Data.IAspNetRoles.Name
        {
            get
            {
                return this._Name;
            }
            set
            {
                this.Name = value;
            }
        }
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
        System.Collections.Generic.IEnumerable<IAspNetUsers> global::Sidvall.IdentityManager.Data.IAspNetRoles.AspNetUsers
        {
            get
            {
                return this.AspNetUsers;
            }
        }
        void global::Sidvall.IdentityManager.Data.IAspNetRoles.SetAspNetUsers(Sidvall.Data.IDataRowProvider<global::Sidvall.IdentityManager.Data.IAspNetUsers> items)
        {
            this.AspNetUsers = items as AspNetUsersCollection;
        }

        #endregion

        #endregion
        #region Constructors

        public AspNetRoles() : this(false, null, null)
        {
        }
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
        public AspNetRoles(bool initializeChildren, Sidvall.Data.IDataRowContextProvider context, Sidvall.Data.DataRowState? dataRowState)
        {
            if ((context != null) || (dataRowState != null))
                SetDataRowContext(context, dataRowState);
            if (initializeChildren)
            {
                this.AspNetUsers = new System.Collections.Generic.List<AspNetUsers>();
            }
        }

        #endregion
    }
}